﻿using System;
using System.Collections.Generic;
using System.Text;
using LispInterpretor.HelperClasses;

namespace LispInterpretor.InBuiltProcedures.LogicalOperators
{
    internal class Not : Procedure
    {
        public override object Apply(params object[] args)
        {
            Check.IsTrue(args.Length == 1, "The \"Not\" procedure must have exactly one argument.");

            Check.IsTrue(args[0] is bool, "All arguments to the \"Not\" procedure must be boolean.");

            return !(bool)args[0];
        }
    }
}
